import {url} from './index';
import axios from 'axios';


export const  getshop = async () => {
    console.log(1);
    let result = await axios({
        method:'get',
        url:url+'/shop/getshop',
        params:{}
    })
    return result.data;
}

export const  deleteshop = async (_id) => {
    let result = await axios({
        method:'delete',
        url:url+'/shop/'+_id,
    })
    return result.data;
}
export const  addshop = async (data) => {
    let result = await axios({
        method:'post',
        url:url+'/shop',
        data
    })
    return result.data;
}

// 搜索参数{type,value}
export const  searchshop = async (data) => {
    let result = await axios({
        method:'get',
        url:url+'/shop',
        params:data
    })
    return result.data;
}

export const  updateshop = async (data) => {
    let result = await axios({
        method:'put',
        url:url+`/shop/${data._id}`,
        data
    })
    return result.data;
}
